package com.pilipili.service;

import com.pilipili.dao.updateArticleMapper;
import com.pilipili.pojo.UpdateArticle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class updateArticleServiceImpl implements updateArticleService{
    @Autowired
    updateArticleMapper updateArticleMapper;

    @Override
    @Cacheable(value = "UpdateArticle")
    public List<UpdateArticle> selectUpdateArticle() {
        return updateArticleMapper.selectUpdateArticle();
    }

    @Override
    @CacheEvict(value="UpdateArticle", allEntries=true)
    public int insertUpdateArticle(UpdateArticle updateArticle) {
        return updateArticleMapper.insertUpdateArticle(updateArticle);
    }
}
